<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>注册组件语法糖写法</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
<div id="app">
    <cpn1></cpn1>
    <cpn2></cpn2>
</div>
</body>
<script>
    //1.注册全局组件语法糖
    Vue.component('cpn1',{
        template:`
            <div>
                <h2>全局组件语法糖</h2>
                 <p>全局组件语法糖</p>
            </div>`
    })

    const app = new Vue({
        el:"#app",
        components:{//局部组件创建
            cpn2:{
                template: `
            <div>
                <h2>局部组件语法糖</h2>
                 <p>局部组件语法糖</p>
            </div>`
            }
        }
    })
</script>
</html>